<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>用户查询详情</title>
  <!--[if lt IE 9]>
  <script src="libs/html5shiv.min.js"></script>
  <script src="libs/respond.min.js"></script>
  <![endif]-->
  <script src="libs/jquery-1.12.1.min.js"></script>
  <script type="text/javascript" src="libs/getQueryString.js"></script>
  <link href="libs/bootstrap-3.3.6/css/bootstrap.min.css" rel="stylesheet">
  <script type="text/javascript" src="libs/handlebars.min.js" ></script>
  <script src="libs/bootstrap-3.3.6/js/bootstrap.min.js"></script>
  
</head>
<body>
  <div class="container">
  	 <div class="page-header">
        <h2 class="text-center"><strong>账单</strong></h2>
      </div>
  </div>
 
  <div class="container">
  	<div class="row">
  		<div class="col-md-12">
  			<ul class="nav nav-pills" >
  				<li >
  					<a href="homepage.html"  >首页</a>
  				</li>
  				<li class="active">
  					<a href="yonghu.html" >用户:<span id="yh"></span></a>
  				</li>
  				<li >
  					<a href="outadd.html">新加支出</a>
  				</li>
  				<li >
  					<a href="inadd.html">新加收入</a>
  				</li>
  				<li >
  					<a href="sta.html">统计</a>
  				</li>
  				<li >
  					<a href="search.html">查询</a>
  				</li>
  			</ul>
  		</div>
  	</div>
  </div>
  
  <div class="container">
  	<div class="row">
  		<div class="col-md-12">
  			<hr>
  		</div>
  	</div>
  </div>
  
	<div class="container">			 		
		<div class="row">
	  		<div class="col-md-4 col-md-offset-4">
	  			<div class="panel panel-primary">
	  				<div class="panel-heading">时间</div>
			  		<div class="panel-body" id="map1"></div>
	  			</div>
	  		</div>
	  	</div>  
	</div> 
	<div class="container">			 		
		<div class="row">
	  		<div class="col-md-4 col-md-offset-4">
	  			<div class="panel panel-primary">
	  				<div class="panel-heading">地点</div>
			  		<div class="panel-body" id="map2"></div>
	  			</div>
	  		</div>
	  	</div>  
	</div>
	<div class="container">			 		
		<div class="row">
	  		<div class="col-md-4 col-md-offset-4">
	  			<div class="panel panel-primary">
	  				<div class="panel-heading">收入</div>
			  		<div class="panel-body" id="map3"></div>
	  			</div>
	  		</div>
	  	</div>  
	</div>
	<div class="container">			 		
		<div class="row">
	  		<div class="col-md-4 col-md-offset-4">
	  			<div class="panel panel-primary">
	  				<div class="panel-heading">支出</div>
			  		<div class="panel-body" id="map4"></div>
	  			</div>
	  		</div>
	  	</div>  
	</div>
	<div class="container">			 		
		<div class="row">
	  		<div class="col-md-4 col-md-offset-4">
	  			<div class="panel panel-primary">
	  				<div class="panel-heading">类别</div>
			  		<div class="panel-body" id="map5"></div>
	  			</div>
	  		</div>
	  	</div>  
	</div>
	<div class="container">			 		
		<div class="row">
	  		<div class="col-md-4 col-md-offset-4">
	  			<div class="panel panel-primary">
	  				<div class="panel-heading">备注</div>
			  		<div class="panel-body" id="map6"></div>
	  			</div>
	  		</div>
	  	</div>  
	</div> 

  <div class="container">
  	<div class="row">
  		<div class="col-md-12">
  			<hr>
  		</div>
  	</div>
  </div>
  <div class="container">
  	<div class="row">
  		<div class="col-md-2 col-md-offset-5">
  			<button id="del" class="btn btn-primary btn-block">删除</button>
  		</div>
  	</div>
  </div>
  

<script type="text/javascript">
$(function(){
	$.getJSON('users.action',function(res){
		$('#yh').text(res.nickname);
	})
		var id=getQueryString('id');
		var url = 'details.action?id= ' + id;
		/* console.log(id);
	  	console.log(url); */
	$.getJSON(url, function (res) {
		$('#map1').text(res.date_time);
		$('#map2').text(res.place);
		$('#map3').text(res.money_in);
		$('#map4').text(res.money_out);
		$('#map5').text(res.kind);
		$('#map6').text(res.remark);
	})
	$('#del').click(function(){
		$.post('del.action',{
			id:id
		},function(res){
			if("w"==res){
				//window.setTimeout("alert('Hello, world')", 1000);

				window.location.href='sta.html';
			}
		})
	})

})
</script>

</body>
</html>